3.50 \(\int \sin ^2(e+f x) (a+b \tan ^2(e+f x))^2 \, dx\)

Optimal. Leaf size=85 \[ -\frac {(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {1}{2} x (a-5 b) (a-b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

[Out]

1/2*(a-5*b)*(a-b)*x-1/2*(a-5*b)*(a-b)*tan(f*x+e)/f+1/2*(a-b)^2*sin(f*x+e)^2*tan(f*x+e)/f+1/3*b^2*tan(f*x+e)^3/
f

________________________________________________________________________________________

Rubi [A]  time = 0.11, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3663, 463, 459, 321, 203} \[ -\frac {(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {1}{2} x (a-5 b) (a-b)+\frac {b^2 \tan ^3(e+f x)}{3 f} \]

Antiderivative was successfully verified.

[In]

Int[Sin[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

((a - 5*b)*(a - b)*x)/2 - ((a - 5*b)*(a - b)*Tan[e + f*x])/(2*f) + ((a - b)^2*Sin[e + f*x]^2*Tan[e + f*x])/(2*
f) + (b^2*Tan[e + f*x]^3)/(3*f)

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 459

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(d*(e*x)^(m
+ 1)*(a + b*x^n)^(p + 1))/(b*e*(m + n*(p + 1) + 1)), x] - Dist[(a*d*(m + 1) - b*c*(m + n*(p + 1) + 1))/(b*(m +
 n*(p + 1) + 1)), Int[(e*x)^m*(a + b*x^n)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x] && NeQ[b*c - a*d, 0]
 && NeQ[m + n*(p + 1) + 1, 0]

Rule 463

Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^2, x_Symbol] :> -Simp[((b*c - a*
d)^2*(e*x)^(m + 1)*(a + b*x^n)^(p + 1))/(a*b^2*e*n*(p + 1)), x] + Dist[1/(a*b^2*n*(p + 1)), Int[(e*x)^m*(a + b
*x^n)^(p + 1)*Simp[(b*c - a*d)^2*(m + 1) + b^2*c^2*n*(p + 1) + a*b*d^2*n*(p + 1)*x^n, x], x], x] /; FreeQ[{a,
b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LtQ[p, -1]

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rubi steps

\begin {align*} \int \sin ^2(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a+b x^2\right )^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}-\frac {\operatorname {Subst}\left (\int \frac {x^2 \left (a^2-6 a b+3 b^2-2 b^2 x^2\right )}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}-\frac {((a-5 b) (a-b)) \operatorname {Subst}\left (\int \frac {x^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=-\frac {(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}+\frac {((a-5 b) (a-b)) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{2 f}\\ &=\frac {1}{2} (a-5 b) (a-b) x-\frac {(a-5 b) (a-b) \tan (e+f x)}{2 f}+\frac {(a-b)^2 \sin ^2(e+f x) \tan (e+f x)}{2 f}+\frac {b^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.73, size = 71, normalized size = 0.84 \[ \frac {6 \left (a^2-6 a b+5 b^2\right ) (e+f x)-3 (a-b)^2 \sin (2 (e+f x))+4 b \tan (e+f x) \left (6 a+b \sec ^2(e+f x)-7 b\right )}{12 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Sin[e + f*x]^2*(a + b*Tan[e + f*x]^2)^2,x]

[Out]

(6*(a^2 - 6*a*b + 5*b^2)*(e + f*x) - 3*(a - b)^2*Sin[2*(e + f*x)] + 4*b*(6*a - 7*b + b*Sec[e + f*x]^2)*Tan[e +
 f*x])/(12*f)

________________________________________________________________________________________

fricas [A]  time = 0.56, size = 94, normalized size = 1.11 \[ \frac {3 \, {\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} f x \cos \left (f x + e\right )^{3} - {\left (3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (f x + e\right )^{4} - 2 \, {\left (6 \, a b - 7 \, b^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, b^{2}\right )} \sin \left (f x + e\right )}{6 \, f \cos \left (f x + e\right )^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="fricas")

[Out]

1/6*(3*(a^2 - 6*a*b + 5*b^2)*f*x*cos(f*x + e)^3 - (3*(a^2 - 2*a*b + b^2)*cos(f*x + e)^4 - 2*(6*a*b - 7*b^2)*co
s(f*x + e)^2 - 2*b^2)*sin(f*x + e))/(f*cos(f*x + e)^3)

________________________________________________________________________________________

giac [B]  time = 22.94, size = 1411, normalized size = 16.60 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="giac")

[Out]

1/6*(3*a^2*f*x*tan(f*x)^5*tan(e)^5 - 18*a*b*f*x*tan(f*x)^5*tan(e)^5 + 15*b^2*f*x*tan(f*x)^5*tan(e)^5 + 3*a^2*f
*x*tan(f*x)^5*tan(e)^3 - 18*a*b*f*x*tan(f*x)^5*tan(e)^3 + 15*b^2*f*x*tan(f*x)^5*tan(e)^3 - 9*a^2*f*x*tan(f*x)^
4*tan(e)^4 + 54*a*b*f*x*tan(f*x)^4*tan(e)^4 - 45*b^2*f*x*tan(f*x)^4*tan(e)^4 + 3*a^2*f*x*tan(f*x)^3*tan(e)^5 -
 18*a*b*f*x*tan(f*x)^3*tan(e)^5 + 15*b^2*f*x*tan(f*x)^3*tan(e)^5 + 3*a^2*tan(f*x)^5*tan(e)^4 - 18*a*b*tan(f*x)
^5*tan(e)^4 + 15*b^2*tan(f*x)^5*tan(e)^4 + 3*a^2*tan(f*x)^4*tan(e)^5 - 18*a*b*tan(f*x)^4*tan(e)^5 + 15*b^2*tan
(f*x)^4*tan(e)^5 - 9*a^2*f*x*tan(f*x)^4*tan(e)^2 + 54*a*b*f*x*tan(f*x)^4*tan(e)^2 - 45*b^2*f*x*tan(f*x)^4*tan(
e)^2 + 12*a^2*f*x*tan(f*x)^3*tan(e)^3 - 72*a*b*f*x*tan(f*x)^3*tan(e)^3 + 60*b^2*f*x*tan(f*x)^3*tan(e)^3 - 9*a^
2*f*x*tan(f*x)^2*tan(e)^4 + 54*a*b*f*x*tan(f*x)^2*tan(e)^4 - 45*b^2*f*x*tan(f*x)^2*tan(e)^4 - 12*a*b*tan(f*x)^
5*tan(e)^2 + 10*b^2*tan(f*x)^5*tan(e)^2 - 12*a^2*tan(f*x)^4*tan(e)^3 + 36*a*b*tan(f*x)^4*tan(e)^3 - 30*b^2*tan
(f*x)^4*tan(e)^3 - 12*a^2*tan(f*x)^3*tan(e)^4 + 36*a*b*tan(f*x)^3*tan(e)^4 - 30*b^2*tan(f*x)^3*tan(e)^4 - 12*a
*b*tan(f*x)^2*tan(e)^5 + 10*b^2*tan(f*x)^2*tan(e)^5 + 9*a^2*f*x*tan(f*x)^3*tan(e) - 54*a*b*f*x*tan(f*x)^3*tan(
e) + 45*b^2*f*x*tan(f*x)^3*tan(e) - 12*a^2*f*x*tan(f*x)^2*tan(e)^2 + 72*a*b*f*x*tan(f*x)^2*tan(e)^2 - 60*b^2*f
*x*tan(f*x)^2*tan(e)^2 + 9*a^2*f*x*tan(f*x)*tan(e)^3 - 54*a*b*f*x*tan(f*x)*tan(e)^3 + 45*b^2*f*x*tan(f*x)*tan(
e)^3 - 2*b^2*tan(f*x)^5 + 24*a*b*tan(f*x)^4*tan(e) - 30*b^2*tan(f*x)^4*tan(e) + 18*a^2*tan(f*x)^3*tan(e)^2 - 3
6*a*b*tan(f*x)^3*tan(e)^2 + 10*b^2*tan(f*x)^3*tan(e)^2 + 18*a^2*tan(f*x)^2*tan(e)^3 - 36*a*b*tan(f*x)^2*tan(e)
^3 + 10*b^2*tan(f*x)^2*tan(e)^3 + 24*a*b*tan(f*x)*tan(e)^4 - 30*b^2*tan(f*x)*tan(e)^4 - 2*b^2*tan(e)^5 - 3*a^2
*f*x*tan(f*x)^2 + 18*a*b*f*x*tan(f*x)^2 - 15*b^2*f*x*tan(f*x)^2 + 9*a^2*f*x*tan(f*x)*tan(e) - 54*a*b*f*x*tan(f
*x)*tan(e) + 45*b^2*f*x*tan(f*x)*tan(e) - 3*a^2*f*x*tan(e)^2 + 18*a*b*f*x*tan(e)^2 - 15*b^2*f*x*tan(e)^2 - 12*
a*b*tan(f*x)^3 + 10*b^2*tan(f*x)^3 - 12*a^2*tan(f*x)^2*tan(e) + 36*a*b*tan(f*x)^2*tan(e) - 30*b^2*tan(f*x)^2*t
an(e) - 12*a^2*tan(f*x)*tan(e)^2 + 36*a*b*tan(f*x)*tan(e)^2 - 30*b^2*tan(f*x)*tan(e)^2 - 12*a*b*tan(e)^3 + 10*
b^2*tan(e)^3 - 3*a^2*f*x + 18*a*b*f*x - 15*b^2*f*x + 3*a^2*tan(f*x) - 18*a*b*tan(f*x) + 15*b^2*tan(f*x) + 3*a^
2*tan(e) - 18*a*b*tan(e) + 15*b^2*tan(e))/(f*tan(f*x)^5*tan(e)^5 + f*tan(f*x)^5*tan(e)^3 - 3*f*tan(f*x)^4*tan(
e)^4 + f*tan(f*x)^3*tan(e)^5 - 3*f*tan(f*x)^4*tan(e)^2 + 4*f*tan(f*x)^3*tan(e)^3 - 3*f*tan(f*x)^2*tan(e)^4 + 3
*f*tan(f*x)^3*tan(e) - 4*f*tan(f*x)^2*tan(e)^2 + 3*f*tan(f*x)*tan(e)^3 - f*tan(f*x)^2 + 3*f*tan(f*x)*tan(e) -
f*tan(e)^2 - f)

________________________________________________________________________________________

maple [B]  time = 0.70, size = 168, normalized size = 1.98 \[ \frac {a^{2} \left (-\frac {\sin \left (f x +e \right ) \cos \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+2 a b \left (\frac {\sin ^{5}\left (f x +e \right )}{\cos \left (f x +e \right )}+\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )-\frac {3 f x}{2}-\frac {3 e}{2}\right )+b^{2} \left (\frac {\sin ^{7}\left (f x +e \right )}{3 \cos \left (f x +e \right )^{3}}-\frac {4 \left (\sin ^{7}\left (f x +e \right )\right )}{3 \cos \left (f x +e \right )}-\frac {4 \left (\sin ^{5}\left (f x +e \right )+\frac {5 \left (\sin ^{3}\left (f x +e \right )\right )}{4}+\frac {15 \sin \left (f x +e \right )}{8}\right ) \cos \left (f x +e \right )}{3}+\frac {5 f x}{2}+\frac {5 e}{2}\right )}{f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x)

[Out]

1/f*(a^2*(-1/2*sin(f*x+e)*cos(f*x+e)+1/2*f*x+1/2*e)+2*a*b*(sin(f*x+e)^5/cos(f*x+e)+(sin(f*x+e)^3+3/2*sin(f*x+e
))*cos(f*x+e)-3/2*f*x-3/2*e)+b^2*(1/3*sin(f*x+e)^7/cos(f*x+e)^3-4/3*sin(f*x+e)^7/cos(f*x+e)-4/3*(sin(f*x+e)^5+
5/4*sin(f*x+e)^3+15/8*sin(f*x+e))*cos(f*x+e)+5/2*f*x+5/2*e))

________________________________________________________________________________________

maxima [A]  time = 0.84, size = 87, normalized size = 1.02 \[ \frac {2 \, b^{2} \tan \left (f x + e\right )^{3} + 3 \, {\left (a^{2} - 6 \, a b + 5 \, b^{2}\right )} {\left (f x + e\right )} + 12 \, {\left (a b - b^{2}\right )} \tan \left (f x + e\right ) - \frac {3 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{2} + 1}}{6 \, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)^2*(a+b*tan(f*x+e)^2)^2,x, algorithm="maxima")

[Out]

1/6*(2*b^2*tan(f*x + e)^3 + 3*(a^2 - 6*a*b + 5*b^2)*(f*x + e) + 12*(a*b - b^2)*tan(f*x + e) - 3*(a^2 - 2*a*b +
 b^2)*tan(f*x + e)/(tan(f*x + e)^2 + 1))/f

________________________________________________________________________________________

mupad [B]  time = 11.80, size = 114, normalized size = 1.34 \[ \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,a\,b-2\,b^2\right )}{f}+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^3}{3\,f}-\frac {\sin \left (2\,e+2\,f\,x\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )}{2\,f}+\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (a-b\right )\,\left (a-5\,b\right )}{2\,\left (\frac {a^2}{2}-3\,a\,b+\frac {5\,b^2}{2}\right )}\right )\,\left (a-b\right )\,\left (a-5\,b\right )}{2\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(e + f*x)^2*(a + b*tan(e + f*x)^2)^2,x)

[Out]

(tan(e + f*x)*(2*a*b - 2*b^2))/f + (b^2*tan(e + f*x)^3)/(3*f) - (sin(2*e + 2*f*x)*(a^2/2 - a*b + b^2/2))/(2*f)
 + (atan((tan(e + f*x)*(a - b)*(a - 5*b))/(2*(a^2/2 - 3*a*b + (5*b^2)/2)))*(a - b)*(a - 5*b))/(2*f)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right )^{2} \sin ^{2}{\left (e + f x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(f*x+e)**2*(a+b*tan(f*x+e)**2)**2,x)

[Out]

Integral((a + b*tan(e + f*x)**2)**2*sin(e + f*x)**2, x)

________________________________________________________________________________________